import com.Config;
import com.controller.UserController;
import com.serverThread.TestServerThread;
import org.apache.log4j.Logger;
import org.junit.Test;
import top.appx.espring.annotation.RequestParam;
import top.appx.zutil.DateTime;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;

/**
 * Created by john on 2016/8/13.
 */
public class T {
    @Test
    public void t1() throws Exception {

        Method[] methods = UserController.class.getMethods();
        Method method = null;
        for(Method method1 : methods){
            if(method1.getName().equals("modifyPassword")){
                method = method1;
            }
        }
        Annotation[][] anss = method.getParameterAnnotations();
        for(int i=0;i<3;i++){
            Annotation[] ans = anss[i];
            for(Annotation an : ans){
                System.out.println(an.annotationType());
                if(an.getClass().equals(RequestParam.class)){
                    RequestParam requestParam = (RequestParam)an;
                    System.out.println("名称:");
                    System.out.println(requestParam.value());

                }
            }
        }

    }
}
